﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;

namespace SpriteEditor
{
    public class Selection
    {
        public Point P1 { get; set; }
        public Point P2 { get; set; }
    }

    public class ModuleSelection : Selection
    {
        public int CurrentModuleIndex { get; set; }

        //public Control MainControl { get; set; }
        //public Graphics GrPh { get; set; }
        //public Pen CurrentPent { get; set; }

        //public void UpdateControl(Control ctr)
        //{
        //    MainControl = ctr;
        //    GrPh = MainControl.CreateGraphics();
        //}

        //public Selection(Control ctr)
        //{
        //    UpdateControl(ctr);
        //    CurrentPent = new Pen(Color.Red);
        //}

        //public void Paint()
        //{
        //    GrPh.Clear(MainControl.BackColor);
        //    if(MainControl.BackgroundImage!=null)
        //        GrPh.DrawImage(MainControl.BackgroundImage, 0, 0);
        //    GrPh.DrawRectangle(CurrentPent, P1.X, P1.Y, P2.X - P1.X, P2.Y - P1.Y);
        //}

        public ModuleSelection()
        {
            P1 = new Point();
            P2 = new Point();
            CurrentModuleIndex = 0;
        }

        public ModuleSelection clone()
        {
            ModuleSelection ms = new ModuleSelection();
            ms.P1 = this.P1;
            ms.P2 = this.P2;
            ms.CurrentModuleIndex = this.CurrentModuleIndex;
            return ms;
        }
    }

    public class FrameSelection : Selection
    {
        public int CurrentFrameIndex { get; set; }
        public int CurrentModuleOfFrameIndex { get; set; }
        public int CurrentModuleIndex { get; set; }
    }

    public class AnimationSelection : Selection
    {
        public int CurrentAnimationIndex { get; set; }
        public int CurrentFrameOfAnimationIndex { get; set; }
        public int CurrentFrameIndex { get; set; }
    }
}
